<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>预约历史</title>

    <link rel="stylesheet" href="../css/page-health-report.css" />
</head>

<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
    <div class="app">
        <!-- 页面头部 -->
        <div class="top-header">
            <span class="f-left"><i class="icon-back" onclick="c1()"></i>返回</span>
            <span class="center">预约历史</span>
            <span class="f-right"><i class="icon-more"></i></span>
        </div>
        <!-- 页面内容 -->
        <div class="contentBox">
            <div class="list-row3" id="t1">
<!--                <div class="report-item">-->
<!--                    <div class="item-name">-->
<!--                        <div class="info">-->
<!--                            <span class="name">张小花</span>-->
<!--                            <span class="sex">女</span>-->
<!--                        </div>-->

<!--                    </div>-->
<!--                    <div class="item-content">-->
<!--                        <ul class="box">-->
<!--                            <li>体检日期：<span>2016-10-26</span></li>-->
<!--                            <li>档案号：<span>00109000830</span></li>-->
<!--                            <li>体检套餐：<span>入职体检</span></li>-->
<!--                            <li>上传时间：<span>2016-10-26  10:25</span></li>-->
<!--                        </ul>-->
<!--                    </div>-->
<!--                    <div class="item-link">-->
<!--                        预约详情-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="report-item">-->
<!--                    <div class="item-name">-->
<!--                        <div class="info">-->
<!--                            <span class="name">张小花</span>-->
<!--                            <span class="sex">女</span>-->
<!--                        </div>-->

<!--                    </div>-->
<!--                    <div class="item-content">-->
<!--                        <ul class="box">-->
<!--                            <li>体检日期：<span>2016-10-26</span></li>-->
<!--                            <li>档案号：<span>00109000830</span></li>-->
<!--                            <li>体检套餐：<span>入职体检</span></li>-->
<!--                            <li>上传时间：<span>2016-10-26  10:25</span></li>-->
<!--                        </ul>-->
<!--                    </div>-->
<!--                    <div class="item-link">-->
<!--                        预约详情-->
<!--                    </div>-->
<!--                </div>-->
            </div>
        </div>
    </div>
    <script src="plugins/jquery/dist/jquery.min.js"></script>

<script>
    function c1(){
        window.location="health-index.html"
    }
    $.ajax({
        url:"orderhistory",
        headers:{
            //Bearer token的规范是：Authorization名称的头，值为Bearer空格+具体的jwt串
            "Authorization":"Bearer " + localStorage.getItem("token")
        },
        type:"get",
        "success": function (data) {
                console.log(data)

                var mems = data.data;
                var str ="";
                for (let i = 0; i < mems.length; i++) {
                    str += "       <div className=\"report-item\">\n" +
                        "            <div className=\"item-name\">\n" +
                        "                <div className=\"info\">\n" +
                        "                    <span className=\"name\">"+mems[i].name+"</span>\n" +
                        "                    <span className=\"sex\">"+mems[i].sex+"</span>\n" +
                        "                </div>\n" +
                        "            </div>\n" +
                        "            <div className=\"item-content\">\n" +
                        "                <ul className=\"box\">\n" +
                        "                    <li>体检日期：<span>"+mems[i].orderDate+"</span></li>\n" +
                        "                    <li>档案号：<span>"+mems[i].id+"</span></li>\n" +
                        "                    <li>体检套餐：<span>"+mems[i].setMealName+"</span></li>\n" +
                        "                </ul>\n" +
                        "            </div>\n" +
                        "            <div className=\"item-link\" onclick=\"c2("+mems[i].id+")\">\n" +
                        "                取消预约\n" +
                        "            </div>\n" +
                        "        </div>"

                }
                t1.innerHTML =str;
            }

    })

    function c2(id){
        $.get("orderhistory/deleteOrder", {id:id},
            function (data) {
            console.log(data)
        },"json")
    }
</script>


</body>